package com.shop.front.property;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author Administrator
 * @Date 2024/4/16 14:34
 * @Version 1.0
 */
@Component
public class WxpayConstant {

    /**
     * 商户号
     */
    public static String mchId;

    /**
     * 公众号appid
     */
    public static String appId;

    /**
     * 公众号sercet
     */
    public static String appSecret;

    /**
     * 商户APIV3密钥
     */
    public static String apiV3Key;

    /**
     * 商户API私钥路径
     */
    public static String privateKeyPath;

    /**
     * 微信回调地址
     */
    public static String notifyUrl;

    /**
     * 微信回调地址
     */
    public static String openIdNotifyUrl;

    /**
     * 商户证书序列号
     */
    public static String merchantSerialNumber;

    public static String getMchId() {
        return mchId;
    }

    @Value("${wx.mchId}")
    public void setMchId(String mchId) {
        WxpayConstant.mchId = mchId;
    }

    public static String getAppId() {
        return appId;
    }

    @Value("${wx.appId}")
    public void setAppId(String appId) {
        WxpayConstant.appId = appId;
    }

    public static String getAppSecret() {
        return appSecret;
    }

    @Value("${wx.appSecret}")
    public void setAppSecret(String appSecret) {
        WxpayConstant.appSecret = appSecret;
    }

    public static String getApiV3Key() {
        return apiV3Key;
    }

    @Value("${wx.apiV3Key}")
    public void setApiV3Key(String apiV3Key) {
        WxpayConstant.apiV3Key = apiV3Key;
    }

    public static String getPrivateKeyPath() {
        return privateKeyPath;
    }

    @Value("${wx.privateKeyPath}")
    public void setPrivateKeyPath(String privateKeyPath) {
        WxpayConstant.privateKeyPath = privateKeyPath;
    }

    public String getNotifyUrl() {
        return notifyUrl;
    }

    @Value("${wx.notifyUrl}")
    public void setNotifyUrl(String notifyUrl) {
        WxpayConstant.notifyUrl = notifyUrl;
    }

    public static String getOpenIdNotifyUrl() {
        return openIdNotifyUrl;
    }

    @Value("${wx.openIdNotifyUrl}")
    public void setOpenIdNotifyUrl(String openIdNotifyUrl) {
        WxpayConstant.openIdNotifyUrl = openIdNotifyUrl;
    }

    public static String getMerchantSerialNumber() {
        return merchantSerialNumber;
    }

    @Value("${wx.merchantSerialNumber}")
    public void setMerchantSerialNumber(String merchantSerialNumber) {
        WxpayConstant.merchantSerialNumber = merchantSerialNumber;
    }
}
